package main.java.com.uycode.stream;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class Tests {

    public static void main(String[] args) {
        Input input = new Input();
        input.setName("Ahmatjan");
        Company company1 = new Company();
        Company company2 = new Company();
        company1.setCompanyCode("1");
        company1.setCompanyName("财信金科");
        company2.setCompanyCode("2");
        company2.setCompanyName("财信证券");
        List<Company> companies = new ArrayList<>();
        companies.add(company1);
        companies.add(company2);
        input.setCompanyList(companies);

        List<String> companyList;
        companyList = input.getCompanyList().stream().map(Company::getCompanyCode).collect(Collectors.toList());

        companyList.forEach(System.out::println);
        /*for (String company: companyList
             ) {
            System.out.println(company);
        }*/
    }
}
